#include "NaviDAQPropertySpec.h"

typedef struct _CTRLPROPERTY
{
    int index;
    char description[256];
    int type;
    char value[256];
    bool writable;
    bool iscollection;
    int ctrltype;
    PropertyId id;
    void CopyFrom(_CTRLPROPERTY* source)
    {
        index = source->index;
        memcpy(description, source->description, 256);
        type = source->type;
        memcpy(value, source->value, 256);
        writable = source->writable;
        iscollection = source->iscollection;
        ctrltype = source->ctrltype;
        id = source->id;
    }
}CTRLPROPERTY, *PCTRLPROPERTY;

class DAQCtrlPropertyConfig
{
public:
    DAQCtrlPropertyConfig();
    virtual ~DAQCtrlPropertyConfig();

    bool GetSpecFromFile(char* pszfilename);
    void DisplayPropDetail();
    void WriteSpecTofile();
    void FillSpecBlank(PCTRLPROPERTY pvalue);
    void SetBufferAIRelatedProperty(BufferedAiCtrl** pctrl);
    void SetInstantAIRelatedProperty(InstantAiCtrl** pctrl);
    void SetBufferAORelatedProperty(BufferedAoCtrl** pctrl);
    void SetInstantAORelatedProperty(InstantAoCtrl** pctrl);
    void SetInstantDIRelatedProperty(InstantDiCtrl** pctrl);
    void SetCounterBaseRelatedProperty(HANDLE hmodule);
    bool SetPropertyByID(HANDLE hmodule, PropertyId id, char** pvalue);
    void GetPropertyDetail(HANDLE hmodule, int property_id, BIO_DEV_PROPERTY_DETAIL* p_detail, int* p_errorCode);
    void DisplayPropertyDetail(BIO_DEV_PROPERTY_DETAIL detail);


protected:
    vector<CTRLPROPERTY> m_vProperty_Spec;
    vector<CTRLPROPERTY> m_vProperty_ReadBack;
    char szFileName[256];
    
};
